﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendNews.aspx.cs" Inherits="ZX.WebApp.Crm.SendNews" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../Styles/base.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../Scripts/CombinButton.js" type="text/javascript"></script>
    <link href="../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <script src="../Scripts/extend.validate.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <link href="../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <link href="../Message/cssjs/message.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .tabck
        {
            width: 100%;
        }
        .tableContent
        {
            font-size: 12px;
        }
        .tableContent th
        {
            border: solid 1px #D4DBE2;
            font-weight: bold;
            background-color: #F2F8FF;
            white-space: nowrap;
            line-height: 28px;
            text-align: left;
            padding-left: 3px;
        }
        .tableContent td
        {
            border: solid 1px #D4DBE2;
            background-color: #F2F8FF;
            line-height: 28px;
            text-align: left;
            padding-left: 3px;
        }
        .textbox
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: white;
            overflow: hidden;
            height: 100%;
            width: 98%;
        }
        .style6
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: white;
            overflow: hidden;
            height: 100%;
            width: 98%;
        }
        .labmessage
        {
            color: Red;
        }
    </style>
</head>
<body class="yui-skin-sam">
    <form id="form1" class="formBuilderForm" runat="server">
    <table class="tableContent">
        <tr>
            <td width="100">
                选择对象：
            </td>
            <td>
                <asp:DropDownList ID="selectOption" runat="server" AppendDataBoundItems="true" Width="160">
                    <asp:ListItem Value="0">组织架构</asp:ListItem>
                    <asp:ListItem Value="1">客户</asp:ListItem>
                </asp:DropDownList>
                <button id="btnPM" name="mzx" class="btnCheck" type="button" style="width: 80px;
                    height: 25px;">
                    选择对象组..</button>
            </td>
        </tr>
        <tr>
            <td>
                接收人员：
            </td>
            <td>
                <input type="hidden" id="PM" runat="server" />
                <textarea id="txtPM" name="receave" rows="3" readonly="readonly" runat="server" style="width: 480px;
                    background-color: Silver"></textarea>
            </td>
        </tr>
        <tr>
            <td>
                消息标题：
            </td>
            <td>
                <input type="hidden" id="Hidden1" runat="server" />
                <textarea id="txtTitle" name="receave" rows="1" runat="server" style="width: 480px;"></textarea>
            </td>
        </tr>
        <tr>
            <td>
                消息内容：<span style="color: Red">*</span>
            </td>
            <td>
                <input type="hidden" id="MODEL" runat="server" />
                <textarea id="txtMODEL" name="receave" rows="10" runat="server" style="width: 480px;"></textarea>
            </td>
        </tr>
        <tr>
            <td width="100">
                发送方式：
            </td>
            <td>
                <asp:DropDownList ID="ddlSendmode" runat="server" Enabled="false" Width="160">
                    <asp:ListItem Value="系统消息">系统消息</asp:ListItem>
                    <asp:ListItem Value="短信">短信</asp:ListItem>
                    <asp:ListItem Value="邮件">邮件</asp:ListItem>
                    <asp:ListItem Value="QQ">QQ</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:HiddenField ID="hdfuserid" runat="server" />
                <asp:Button ID="btnsend" runat="server" Text="发送" class="btnCheck" OnClientClick="return checkmes();"
                    Style="width: 80px; height: 25px;" onclick="btnsend_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Label CssClass="labmessage" ID="Labmes" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
    </table>
    <div id="dialog1" class="yui-pe-content">
        <div class="hd">
            信息选择</div>
        <div class="bd">
            <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    </form>
</body>
<script language="javascript" type="text/javascript" src="../Scripts/DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript">
    var addUser = '<% =UserId %>';

    function checkmes() {
        var btn = document.getElementById("btnsend");
        var user = document.getElementById("txtPM");
        var mess = document.getElementById("txtMODEL");
        if (user.value == null || user.value == "") {
            alert("请选择发送对象");
            return false;
        }
        if (mess.value == null || mess.value == "") {
            alert("请填写消息内容");
            mess.focus();
            return false;
        }
        else if (mess.value.length > 500) {
            alert("请将短信限制在500字符以内，谢谢！");
            mess.focus();
            return false;
        }
        btn.style.display = "none";
        return true;
    }
    //选择对应的方法和ID
    var _fn, _id;
    function ShowDialog1(fn, id, src) {
        _fn = fn;
        _id = id;
        document.getElementById("EditUIWindow1").src = src;
        YAHOO.example.container.dialog1.show();
    }
    YAHOO.namespace("example.container");
    YAHOO.util.Event.onDOMReady(function () {
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow1");
            if (editwindow) {
                editwindow.contentWindow.ChooseInfo();
            }
            YAHOO.example.container.dialog1.hide();
        };
        var handleCancel = function () {
            this.cancel();
        };
        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
					            { width: "580px",
					                height: "400px",
					                fixedcenter: true,
					                visible: false,
					                draggable: true,
					                close: true,
					                autofillheight: "body",
					                constraintoviewport: true,
					                buttons: [{ text: "确定", handler: handleSubmit, isDefault: true },
								            { text: "取消", handler: handleCancel}]
					            });
        YAHOO.example.container.dialog1.callback = { success: handleSuccess, failure: handleFailure };
        YAHOO.example.container.dialog1.render();
    });
</script>
</html>
